﻿// using Sirocco.System.Configuration;

namespace Ostro
{
    ///// <summary>
    ///// Summary description for MistralLayoutConfigTest
    ///// </summary>
    //[TestClass]
    //public class MistralConfigurationSectionTest
    //{
    //    public MistralConfigurationSectionTest()
    //    {
    //        //
    //        // TODO: Add constructor logic here
    //        //
    //    }

    //    private TestContext testContextInstance;

    //    /// <summary>
    //    ///Gets or sets the test context which provides
    //    ///information about and functionality for the current test run.
    //    ///</summary>
    //    public TestContext TestContext
    //    {
    //        get
    //        {
    //            return testContextInstance;
    //        }
    //        set
    //        {
    //            testContextInstance = value;
    //        }
    //    }

    //    #region Additional test attributes
    //    //
    //    // You can use the following additional attributes as you write your tests:
    //    //
    //    // Use ClassInitialize to run code before running the first test in the class
    //    // [ClassInitialize()]
    //    // public static void MyClassInitialize(TestContext testContext) { }
    //    //
    //    // Use ClassCleanup to run code after all tests in a class have run
    //    // [ClassCleanup()]
    //    // public static void MyClassCleanup() { }
    //    //
    //    // Use TestInitialize to run code before running each test 
    //    // [TestInitialize()]
    //    // public void MyTestInitialize() { }
    //    //
    //    // Use TestCleanup to run code after each test has run
    //    // [TestCleanup()]
    //    // public void MyTestCleanup() { }
    //    //
    //    #endregion

    //    [TestMethod]
    //    public void MistralConfigurationSectionTest_Load()
    //    {
    //        MistralConfigurationSection cfg = (MistralConfigurationSection)ConfigurationManager.GetSection("mistral-configuration");
    //        DirectoryConfigurationCollection dir = cfg.General.Directories;

    //        // If the config is loaded succesfully from app.config
    //        // directories collection will have more than 0.
    //        Assert.IsTrue(dir.Count > 0);
    //    }

    //    /// <summary>
    //    /// This unit test will test whether the Root directory has expected value of /
    //    /// </summary>
    //    [TestMethod]
    //    public void MistralConfigurationSectionTest_DirectoriesValue()
    //    {
    //        MistralConfigurationSection cfg = (MistralConfigurationSection)ConfigurationManager.GetSection("mistral-configuration");
    //        DirectoryConfigurationCollection dir = cfg.General.Directories;

    //        // Expected value;
    //        String exp = "/";
    //        String actual = dir["Root"].Value;

    //        Assert.AreEqual(exp, actual);
    //    }

    //    /// <summary>
    //    /// This unit test will test whether if a non-existant key is called, the system will returned NullReferenceException
    //    /// </summary>
    //    [TestMethod]
    //    [ExpectedException(typeof(NullReferenceException))]
    //    public void MistralConfigurationSectionTest_LoadUnrecognizedDir()
    //    {
    //        MistralConfigurationSection cfg = (MistralConfigurationSection)ConfigurationManager.GetSection("mistral-configuration");
    //        DirectoryConfigurationCollection dir = cfg.General.Directories;

    //        // Expected value;
    //        String exp = "/";
    //        String actual = dir["NonExistant"].Value;

    //        // The value for root directory is / 
    //        Assert.AreEqual(exp, actual);
    //    }
    //}
}
